package com.jdiv.samples.particles;

import com.jdiv.JDiv;
import com.jdiv.JProgram;
import com.jdiv.input.JMouse;

/**
 * @author  Joyal
 */
public class Main extends JProgram{

	int numParticles=20;
	/**
	 * @uml.property  name="mouse"
	 * @uml.associationEnd  
	 */
	JMouse mouse=new JMouse();
	
public Main(){

	JDiv.load_image("res/images/p1.png");
	JDiv.load_image("res/images/p2.png");
	JDiv.load_image("res/images/p3.png");
	JDiv.load_image("res/images/p4.png");
	JDiv.load_image("res/images/p5.png");
	JDiv.load_image("res/images/p6.png");
	
	JDiv.load_image("res/images/A.jpg");
	JDiv.load_image("res/images/B.jpg");
	
	  JDiv.load_fpg("res/fpg/tutor2.fpg");
	
	//JDiv.load_image("res/images/001.bmp");
  // JDiv.load_fpg("res/fpg/test3.fpg");
	JDiv.set_title("JDiv Test 6 - Particulas");
	JDiv.set_mode(JDiv.m640x480);
	
//	new Img1();
/*	new Img1();
	new Img2();
	
	
	new Img3();
	new Img3();
	new Img4();
*/
	/*
	
	 for (int i = 0; i < numParticles; i++) {
			new Earth();
	 }
		    */
	
 
 }

 public void loop(){

	 for (int i = 0; i < numParticles; i++) {
         int size = Math.abs(JDiv.rand(10, 90))+10;
         int x1 = mouse.x;
         int y1 = mouse.y;
         int angle =(int) (Math.random()*360000)-180000;
  
          int rand=Math.abs(JDiv.rand(0, 5));
          new Particle(1000+rand,size,x1,y1,angle);
           
       
     }
  
	 //   if (JDiv.key(JDiv._SPACE)){
	
       // }
	      
	           if (JDiv.key(JDiv._SPACE)){
		        	new Earth();
		      
		        }
	
	
 }

 public static void main(String args[]){
		Main m=new Main();
	}
 
}
